package com.qiang.controller;

import com.google.common.collect.Maps;
import org.mvel2.MVEL;
import java.util.Map;
import java.util.Objects;

/**
 * @package: com.qiang.controller
 * @title: MVELController
 * @projectName: burning
 * @description: //TODO
 * @author zhuhongqiang3
 * @date:  2020-04-09 10:08
 * @version: V1.0
 * @retrun com.qiang.controller.burning
 */
public class MVELController extends BaseController{


    public static void main(String[] args) {
        MVELTest();
    }

    private static void MVELTest() {
        String expression = "data.contains('OK') || data.contains('SUCCESS')";
        Map<String, Object> paramMap = Maps.newHashMap();
        paramMap.put("data","O11OSUCCESSK");
        Object eval = MVEL.eval(expression, paramMap);
        System.out.println(eval);    //true
    }

}
